#!/bin/sh

#A Shell Script Which Will Look For Jar Files In the Location Specied
#By Jagadish Manchala
#If You See Any Bugs , Just Dont Come to Me

if [ $# -ne 2 ];
then
    echo "Usage: ./searchjar.sh <keyword>"
    exit
fi

LOOK_FOR="$1"

for i in `find $2 -name "*jar"`
do
    echo "Looking in $i ..."
    jar tvf $i | grep $LOOK_FOR > /dev/null
    if [ $? == 0 ]
    then
        echo "==> Found \"$LOOK_FOR\" in $i"
    fi
done
